
Public Class DAOMonAn
    Public Shared Function MonAn_Load() As DataTable
        Return DataProvider.LoadTable("Select * from MonAn")
    End Function

    Public Shared Sub MonAn_Insert(ByVal n As DTOMonAn)
        Dim sql As String = String.Format("insert into MONAN(TenMA,DonGia,MaHang) values(N'{0}','{1}','{2}')", n.TenMA, n.DonGia, n.MaHang)
        DataProvider.ExecuteNonQuery(sql)
    End Sub

    Public Shared Sub MonAn_Update(ByVal n As DTOMonAn)
        Dim sql As String = String.Format("update MonAn set TenMA = N'{0}', Dongia = '{1}', MaHang = '{2}' where MaMA = '{3}'", _
                                         n.TenMA, n.DonGia, n.MaHang, n.MaMA)
        DataProvider.ExecuteNonQuery(sql)
    End Sub
    Public Shared Sub MonAn_Delete(ByVal n As DTOMonAn)
        If AgreeForm.deleteCaution = False Then
            Return
        End If
        Dim sql As String = String.Format("delete MonAn where MAMA = '{0}'", n.MaMA)
        DataProvider.ExecuteNonQuery(sql)
    End Sub

End Class